<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
    <th:block th:include="include :: header('软件列表')" />
</head>
<body class="gray-bg">
     <div class="container-div">
        <div class="row">
            <div class="col-sm-12 search-collapse">
                <form id="formId">
                    <div class="select-list">
                        <ul>
                            <li>
                                <label>项目类型：</label>
                                <select name="projectType" th:with="type=${@dict.getType('lh_project_type')}">
                                    <option value="">所有</option>
                                    <option th:each="dict : ${type}" th:text="${dict.dictLabel}" th:value="${dict.dictValue}"></option>
                                </select>
                            </li>
                            <li>
                                <label>软件名称：</label>
                                <select name="softwareName">
                                    <option value="">所有</option>
                                    <option th:each="no : ${softwareNameList}" th:text="${no.softwareName}" th:value="${no.softwareName}"></option>
                                </select>
                            </li>
                            <li>
                                <label>软件版本：</label>
                                <select name="softwareVersion">
                                    <option value="">不限</option>
                                    <option th:each="version : ${softwareVersionList}" th:text="${version.softwareVersion}" th:value="${version.softwareVersion}"></option>
                                </select>
                            </li>
                            <li>
                                <label>硬件版本：</label>
                                <input type="text" name="supportHardwareVersion"/>
                            </li>
                            <li>
                                <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
                                <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
                            </li>
                        </ul>
                    </div>
                </form>
            </div>

<!--            <div class="btn-group-sm" id="toolbar" role="group">-->
<!--                <a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="lh:software:add">-->
<!--                    <i class="fa fa-plus"></i> 新增软件更新-->
<!--                </a>-->
<!--                <a class="btn btn-primary single disabled">-->
<!--                    <i class="fa fa-edit"></i> 同步测试项目-->
<!--                </a>-->
<!--                <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="lh:software:remove">-->
<!--                    <i class="fa fa-remove"></i> 批量删除-->
<!--                </a>-->
<!--            </div>-->
            <div class="col-sm-12 select-table table-striped">
                <table id="bootstrap-table"></table>
            </div>
        </div>
    </div>
    <th:block th:include="include :: footer" />
    <script th:inline="javascript">
        var editFlag = [[${@permission.hasPermi('lh:software:edit')}]];
        var removeFlag = [[${@permission.hasPermi('lh:software:remove')}]];
        var statusDatas = [[${@dict.getType('lh_software_status')}]];
        var machineTypeDatas = [[${@dict.getType('lh_machine_type')}]];
        var softwareStrategy = [[${@dict.getType('lh_software_strategy')}]];
        var prefix = ctx + "lh/software";

        $(function() {
            var options = {
                url: prefix + "/list",
                createUrl: prefix + "/add",
                updateUrl: prefix + "/edit/{id}",
                removeUrl: prefix + "/remove",
                exportUrl: prefix + "/export",
                modalName: "软件",
                columns: [{
                    checkbox: true
                },
                {
                    field: 'id',
                    title: '',
                    visible: false
                },
                {
                    field: 'machineName',
                    title: '软件/设备名称'
                },
                {
                    field: 'softwareModel',
                    title: '软件/设备类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(machineTypeDatas, value);
                    }
                },
                {
                    field: 'machineModel',
                    title: '软件/设备型号'
                },
                {
                    field: 'supportHardwareVersion',
                    title: '硬件版本'
                },
                {
                    field: '',
                    title: '原软件名称'
                },
                {
                    field: '',
                    title: '原软件版本'
                },
                {
                    field: 'softwareModel',
                    title: '软件类型',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(machineTypeDatas, value);
                    }
                },
                {
                    field: 'softwareVersion',
                    title: '软件版本'
                },

                {
                    field: 'updateFile',
                    title: '下载路径'
                },
                {
                    field: 'downloadNum',
                    title: '下载次数'
                },
                {
                    field: '',
                    title: '备注',
                    formatter: function(value, row, index) {
                        return $.table.selectDictLabel(softwareStrategy, value);
                    }
                }]
            };
            $.table.init(options);
        });
    </script>
</body>
</html>